import {schollInfo} from "../../api/meshing"
import {getItem,setItem} from '../../utils/storage'
import {SCHOOLID} from "../../constant"
export default{
    state: {
      schoolid : getItem(SCHOOLID) || "",
    },
    mutations: {
      saveSCHOOLID(state,schoolid){
        state.schoolid = schoolid;
        setItem(SCHOOLID,schoolid)
      },
    },
    actions: {
      schoolidinfo({commit},id){
        return new Promise((resolve,reject)=>{
          schollInfo(id).then((res)=>{
            console.log(res);
            if(res.status == 200){
              let schoolid = res.data.data.schoolid
              commit("saveSCHOOLID",schoolid)
            }
            resolve(res)
          }).catch(error => {
            reject(error)
          })
        })
      },
    },
    modules: {
    }
  }
  